"""
@Author : 合肥一元数智教育科技有限公司
@Date :  2025/10/30 10:38
@Description : 
继承中的私有属性
"""
class Aoo:
    __num = 10

    def get_aoo_num(self):
        return self.__num


class Boo(Aoo):
    info = "hello"

    # 在类内部 通过self 访问父类中的私有属性
    def get_num(self):
        # print(self._Aoo__num)   可以 但不推荐
        # print(self.__num)  # 'Boo' object has no attribute '_Boo__num'. Did you mean: '_Aoo__num'?
        print(self.get_aoo_num())


# 创建Boo的实例
boo = Boo()
print(boo.info)
boo.get_num()
